home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
editor
/
blksedtr.lha
/
BED
/
Rexx
/
HuntFile.bed
< prev
next >
Wrap
Text File
|
1996-05-06
|
1KB
|
69 lines
/*
**
** $VER: HuntFile.bed 1.1 (21.04.96)
**
** HuntFile.bed - By Gerbert Nuijen
**
** Hunt the current file under the cursor. Not perfect by far, but it works
** for simple includes and other simple files in the current dir :)
**
*/
OPTIONS RESULTS
GetChar
IF RESULT="" | RESULT="RESULT" | RESULT= " " THEN DO
SetStatusBar "Cursor not on a (correct) word!"
Exit
END
break=FALSE
DO WHILE break=FALSE
Getchar
char = RESULT
IF char="<" THEN DO
break=TRUE
endchar=">"
MoveRight
END
IF char=" " | char="RESULT" THEN DO /* If it is an Return code, RESULT
is given as a RESULT of GetChar */
break=TRUE
endchar=" "
MoveRight
END
MoveLeft
END
exe=""
DO WHILE char ~= endchar
MoveRight
GetChar
char = RESULT
IF char="RESULT" | char=endchar THEN DO /* that's for return codes */
char=endchar
END
ELSE DO
exe = exe || char
END
END
ExistsFile exe
IF RESULT = "YES" THEN DO
OpenDoc exe
EXIT
END
ELSE DO
exe = "Include:" || exe
ExistsFile exe
IF RESULT = "YES" THEN DO
OpenDoc exe
END
ELSE DO
SetStatusBar "Can't find file! : " || exe
END
END